package com.kanavi.batch.service;


import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.kanavi.batch.entity.BatchOrder;
import com.kanavi.batch.entity.BatchOrderParam;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;


@Service
public class RemoteServiceCall {


  public Map<String, Object> queryOrderInfoByCode(String orderCode) {
    return null;
  }

  public List<BatchOrder> queryOrderInfoByCodeBatch(List<BatchOrderParam> params) {
    List<BatchOrder> result = new ArrayList<>();
    for (BatchOrderParam param : params) {
      BatchOrder order = new BatchOrder();
      order.setSerialNo(param.getSerialNo());
      order.setId(RandomUtil.randomLong());
      order.setOrderMoney(RandomUtil.randomBigDecimal());
      order.setOrderTime(DateUtil.date());
      order.setOrderStatus(RandomUtil.randomBoolean());
      order.setOrderCode(RandomUtil.randomString(6));
      result.add(order);
    }
    return result;
  }
}
